package moe.oil.db.repo;

import moe.oil.db.entity.Comments;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Optional;

public interface CommentsRepo extends PagingAndSortingRepository<Comments, Long> {
    // 根据ID查询评论
    Optional<Comments> findByCommentId(Long commentsId);

    // 查询全部评论
    Page<Comments> findAll(Pageable pageable);

    // 根据ID删除评论
    int deleteByCommentId(Long id);
}
